import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 转学记录信息 */
export interface ReportTransfer {
          id: number; // 编号
          processInstanceId: string; // 实例ID
          schoolCode?: string; // 园区
          transferType: string; // 转学类型
          transferDate: string | Dayjs; // 转学日期
          gradeId: number; // 年级ID
          gradeName: string; // 年级
          classId: number; // 班级ID
          className: string; // 转入/出班级
          studentId: number; // 学生ID
          studentName: string; // 学生姓名
          sort?: number; // 排序
          status?: number; // 状态
  }

// 转学记录 API
export const ReportTransferApi = {
  // 查询转学记录分页
  getReportTransferPage: async (params: any) => {
    return await request.get({ url: `/school/report-transfer/page`, params })
  },

  // 查询转学记录详情
  getReportTransfer: async (id: number) => {
    return await request.get({ url: `/school/report-transfer/get?id=` + id })
  },

  // 新增转学记录
  createReportTransfer: async (data: ReportTransfer) => {
    return await request.post({ url: `/school/report-transfer/create`, data })
  },

  // 修改转学记录
  updateReportTransfer: async (data: ReportTransfer) => {
    return await request.put({ url: `/school/report-transfer/update`, data })
  },

  // 删除转学记录
  deleteReportTransfer: async (id: number) => {
    return await request.delete({ url: `/school/report-transfer/delete?id=` + id })
  },

  /** 批量删除转学记录 */
  deleteReportTransferList: async (ids: number[]) => {
    return await request.delete({ url: `/school/report-transfer/delete-list?ids=${ids.join(',')}` })
  },

  // 导出转学记录 Excel
  exportReportTransfer: async (params) => {
    return await request.download({ url: `/school/report-transfer/export-excel`, params })
  },
}